package com.photo.tagger;

import android.content.Context;
import android.view.Gravity;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;

public class TagArea extends LinearLayout{

	
	ImageButton tagSquare;
	TextView tagText;
	
	public TagArea(Context context) {
		super(context);
		tagSquare =new ImageButton(context);
		tagText = new TextView(context);
		this.prepareButton();
		this.prepareLayout();
		this.addItemsToLayout();
		// TODO Auto-generated constructor stub
	}
	public void prepareLayout()
	{
		LayoutParams params=new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
		
		setOrientation(VERTICAL);
	}
	public void prepareButton()
	{
		tagSquare.setImageResource(R.drawable.tag_area);
		
		tagText.setText("ghfgh");
		tagText.setGravity(Gravity.CENTER_HORIZONTAL);
	}
	public void setTagText(String text)
	{
		tagText.setText(text);
	}
	public void addItemsToLayout()
	{
		LayoutParams params=new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT);
		this.addView(tagSquare, params);
		this.addView(tagText, params);
	}
	
	//getter and setter methods
	public ImageButton getTagSquare() {
		return tagSquare;
	}
	public void setTagSquare(ImageButton tagSquare) {
		this.tagSquare = tagSquare;
	}
	public TextView getTagText() {
		return tagText;
	}
	public void setTagText(TextView tagText) {
		this.tagText = tagText;
	}
	//end of getter and setter methods

}
